package com.syni.mdd.yhd.common.all.dto.requestDto.groupBuy;

import com.alibaba.fastjson.JSON;
import com.syni.mdd.yhd.common.all.dto.requestDto.BaseReDto;
import com.syni.mdd.yhd.common.all.utils.StringUtils;
import com.syni.mdd.yhd.common.all.validationGroup.GroupInsert;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @className 团购使用前端接受VO
 * @description TOO
 * @Author cfx
 * @DATE 2019/8/2 9:17
 * @VERSION 1.0
 **/
@Data
public class GroupBuyUseReDto extends BaseReDto {
    private Integer orderId;
    @NotNull(groups = {GroupInsert.class})
    private Integer businessId;
    private List<String> groupBuyUseCode;
    private Integer verNum = 1;
    private Integer verStatus = 1;
    private String searchGroupUseCode;
    private String groupBuyUseCodes;
    private Integer verWay = 1;
    private Integer userCouponId;
    private Integer tip;
    private Integer verCodeExtraWay;
    private String verId;
    public void setGroupBuyUseCodes(String groupBuyUseCodes) {
        if(StringUtils.isNotBlank(groupBuyUseCodes)) {
            this.groupBuyUseCode = JSON.parseArray(groupBuyUseCodes, String.class);
        }
    }
}

